package com.wurao.service.impl;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.security.MessageDigest;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;
import javax.annotation.Resources;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wurao.dao.BlogDao;
import com.wurao.entity.Blog;
import com.wurao.service.BlogService;

/**
 * Service接口
 * @author Administrator
 *
 */
@Service("blogService")
public class BlogServiceImpl implements BlogService{

	@Resource(name="blogDao")
	private BlogDao blogDao;
	
	
	public BlogDao getBlogDao() {
		return blogDao;
	}


	public void setBlogDao(BlogDao blogDao) {
		this.blogDao = blogDao;
	}

	@Override
	public List<Blog> countList() {
		return blogDao.countList();
	}


	@Override
	public Long getTotal(Map<String,Object> map) {
		// TODO Auto-generated method stub
		return blogDao.getTotal(map);
	}

	@Override
	public List<Blog> listBlog(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return blogDao.listBlog(map);
	}
	
	
	@Override
	public Blog findById(Integer id) {
		// TODO Auto-generated method stub
		return blogDao.findById(id);
	}

	@Override
	@Transactional
	public Integer update(Blog blog) {
		// TODO Auto-generated method stub
		return blogDao.update(blog);
	}
	
	@Override
	public Blog getLastBlog(Integer id) {
		// TODO Auto-generated method stub
		return blogDao.getLastBlog(id);
	}
	@Override
	public Blog getNextBlog(Integer id) {
		// TODO Auto-generated method stub
		return blogDao.getNextBlog(id);
	}
	
	
	@Override
	public Integer add(Blog blog) {
		// TODO Auto-generated method stub
		return blogDao.add(blog);
	}
	
	@Override
	public Integer delete(Integer id) {
		// TODO Auto-generated method stub
		return blogDao.delete(id);
	}
	
	@Override
	public Integer getBlogByTypeId(Integer typeId) {
		// TODO Auto-generated method stub
		return blogDao.getBlogByTypeId(typeId); 
	}
	
	@Override
	public List<Blog> listTopBlog(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return blogDao.listTopBlog(map);
	}
	
	@Override
	public List<Blog> topCountList() {
		// TODO Auto-generated method stub
		return blogDao.topCountList();
	}
	

}
